#include <functional>
#include <iostream>
#include <algorithm>
using namespace std;

//https://www.nowcoder.com/questionTerminal/6736cc3ffd1444a4a0057dee89be789b

const int N = 1e5 + 10;
int arr[3 * N];

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < 3 * n; i++) cin >> arr[i];

    sort(arr, &arr[3 * n], greater<>());

    long long ret = 0;
    for (int i = 1; n-- != 0; i += 2)
        ret += arr[i];

    cout << ret << endl;

    return 0;
}
